const main = {
  add: `INSERT INTO JobRequest
    (userId, jobId) VALUES (?, ?)`,
  update: `UPDATE JobRequest SET
    rStatus = ?
    WHERE id = ?`,
  
  select: `SELECT r.*, u.*, j.*, r.id AS requestId FROM JobRequest r
    LEFT JOIN User u ON u.id = r.userId
    LEFT JOIN Jobs j ON j.id = r.JobId
    WHERE (? IS NULL OR r.userId = ?)
    AND (? IS NULL OR j.userId = ?)
    AND (? IS NULL OR r.rStatus IN (?))
    ORDER BY r.id DESC`
};

module.exports = main;